package edu.gyu.myshop.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 快递单号表
 * </p>
 *
 * @author ls
 * @since 2024-06-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class TrackingNumbers implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 订单ID
     */
    private Long orderid;

    /**
     * 物流公司
     */
    private String shippingCompany;

    /**
     * 快递单号
     */
    private String trackingNumber;

    /**
     * 创建时间
     */
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    private LocalDateTime updatedAt;

    public TrackingNumbers(Long orderid, String shippingCompany, String trackingNumber) {
        this.orderid = orderid;
        this.shippingCompany = shippingCompany;
        this.trackingNumber = trackingNumber;
        this.createdAt = LocalDateTime.now(); // 自动设置创建时间
        this.updatedAt = LocalDateTime.now(); // 自动设置创建时间
    }
}
